package com.jeeplus.modules.file.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.common.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.file.entity.FileClassify;
import com.jeeplus.modules.file.dao.FileClassifyDao;

/**
 * 资源共享分类管理Service
 * @author wangkai
 * @version 2017-12-14
 */
@Service
@Transactional(readOnly = true)
public class FileClassifyService extends TreeService<FileClassifyDao, FileClassify> {

	public FileClassify get(String id) {
		return super.get(id);
	}
	
	public List<FileClassify> findList(FileClassify fileClassify) {
		if (StringUtils.isNotBlank(fileClassify.getParentIds())){
			fileClassify.setParentIds(","+fileClassify.getParentIds()+",");
		}
		return super.findList(fileClassify);
	}
	
	public List<FileClassify> findAllList() {
		return dao.findAllList();
	}
	
	@Transactional(readOnly = false)
	public void save(FileClassify fileClassify) {
		super.save(fileClassify);
	}
	
	@Transactional(readOnly = false)
	public void delete(FileClassify fileClassify) {
		super.delete(fileClassify);
	}
	
}